<!--
 * @Descripttion: 生态指标体检
-->
<template>
  <div class="eco-coord-wrapper">
    <!-- 地图 -->
    <div class="page-map">
      <map-view ref="mapview" @initMapView="initMapViewHandler" @mapClickHandler="onMapClickHandler"></map-view>
    </div>
    <!-- 弹框 -->
    <EcoModal :result="result" :type="'1'"/>
  </div>
</template>
<script>
import QueryUtils from "@/utils/yc/QueryUtils";
// 地图组件
import MapView from "@/components/yc/MapView";
import EcoCoord from "@/components/yc/mapFunction/ecoCoord";
import EcoModal from "../components/EcoModal"
export default {
  name: "ecoCoord",
  mixins: [EcoCoord],
  components: {
    MapView,
    EcoModal
  },
  data() {
    return {
      // 当前选项卡
      activeTab: "0",
      //地图对象
      view: null,
      // 结果集
      result: null,
    };
  },
  methods: {
    /**
     * 初始化地图对象
     */
    initMapViewHandler(evt) {
      this.view = evt;
    },
    /**
     * 地图点击处理函数
     * @param {*} event
     */
    async onMapClickHandler(event) {
      this.$refs.mapview.fullscreenLoading = true;
      let feature = this.$refs.mapview.districtFeature;
      let mapPoint = event.mapPoint;
      this.result = await this.queryDistrictByCoord(this.view,feature,mapPoint);
      this.$refs.mapview.fullscreenLoading = false;
    },
  }
};
</script>
<style lang="scss" scoped>
.eco-coord-wrapper {
  position: relative;
  width: 100%;
  height: 100%;

  .page-map {
    position: relative;
    top: 0;
    left: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
  }

  
}
</style>